package com.example.orm_hibernate.controller;

import com.example.orm_hibernate.dao.UserDao;
import com.example.orm_hibernate.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class TestController {
    @Autowired
    private UserDao userDao;

    @GetMapping("/findById")
    public User findById(@RequestParam("id") Long id){
        return userDao.findById(id).get();
    }

    @GetMapping("/findUserAndTwitter")
    public void findUserAndTwitter(@RequestParam("id") Long id){
//        return userDao.findUserAndTwitter(id);
    }
}
